home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / office deutch / OFFICE.NL-NL / OFFICELR.CAB / MSOHLP11.CHM_1043 / html / sexpandcollapse.js < prev    next >
Text File  |  2003-08-19  |  3KB  |  90 lines

  1. function ExpandDiv(theDivName)
  2. {
  3.     if (null == theDivName || typeof(theDivName) == "undefined") return; var theDiv = allDivs[theDivName]; if (null == theDiv || typeof(theDiv) == "undefined") return;
  4.     theDiv.style.display = "block";
  5.  
  6.     var thePic = allImages[theDivName + "_img"];
  7.     if (null != thePic && typeof(thePic) != "undefined")
  8.         thePic.src = "/global/images/default.aspx?AssetID=ZA790050011033";
  9. }
  10.  
  11. function CollapseDiv(theDivName)
  12. {
  13.     if (null == theDivName || typeof(theDivName) == "undefined") return; var theDiv = allDivs[theDivName]; if (null == theDiv || typeof(theDiv) == "undefined") return;
  14.     theDiv.style.display = "none";
  15.  
  16.     var thePic = allImages[theDivName + "_img"];
  17.     if (null != thePic && typeof(thePic) != "undefined")
  18.         thePic.src = "/global/images/default.aspx?AssetID=ZA790050001033";
  19. }
  20.  
  21. function ToggleDiv(theDivName)
  22. {
  23.     if (null == theDivName || typeof(theDivName) == "undefined") return; var theDiv = allDivs[theDivName]; if (null == theDiv || typeof(theDiv) == "undefined") return;
  24.  
  25.     if (theDiv.style.display.toUpperCase() == "NONE")
  26.         ExpandDiv(theDivName);
  27.     else
  28.         CollapseDiv(theDivName);
  29. }
  30.  
  31. function AlterAllDivs(displayStyle)
  32. {
  33.     if (null == allDivs || typeof(allDivs) == "undefined")
  34.         return;        
  35.  
  36.     for (i=0; i < allDivs.length; i++)
  37.         {
  38.         if (0 == allDivs[i].id.indexOf("divExpCollAsst_")) 
  39.             if (displayStyle == "block")
  40.                 ExpandDiv(allDivs[i].id);
  41.             else
  42.                 CollapseDiv(allDivs[i].id);
  43.         }
  44. }
  45.  
  46. function ToggleAllDivs()
  47. {
  48.     if (fExpanded)
  49.     {
  50.         AlterAllDivs("none");
  51.  
  52.         if (null != imgShowAll && typeof(imgShowAll) != "undefined")
  53.             imgShowAll.src = "/global/images/default.aspx?AssetID=ZA790050031033"
  54.     }
  55.     else
  56.     {
  57.         AlterAllDivs("block");
  58.  
  59.         if (null != imgShowAll && typeof(imgShowAll) != "undefined")
  60.             imgShowAll.src = "/global/images/default.aspx?AssetID=ZA790050021033"
  61.     }
  62.  
  63.     fExpanded = !fExpanded;
  64. }
  65.  
  66. function ToggleAll()
  67. {
  68.     ToggleAllDivs();
  69. }
  70.  
  71. var allDivs = document.body.getElementsByTagName("DIV");
  72. var allImages = document.body.getElementsByTagName("IMG");
  73. var fExpanded = false;
  74. var imgShowAll = allImages["picHeader"];
  75.  
  76.  
  77. function openWindow(url, example) {
  78.   var popupWin;
  79.   if (typeof(popupWin) != "object") 
  80.     popupWin = window.open(url, example, "width=452,height=572,top=0,left=0,alwaysRaised=yes,toolbar=0,directories=0,menubar=0,status=1,resizable=yes,location=0,scrollbars=1,copyhistory=0");
  81.   else {
  82.     if (!popupWin.closed) 
  83.       popupWin.location.href = url;
  84.     else 
  85.       popupWin = window.open(url, example, "width=452,height=572,top=0,left=0,alwaysRaised=yes,toolbar=0,directories=0,menubar=0,status=1,resizable=yes,location=0,scrollbars=1,copyhistory=0");
  86.  }      
  87.    
  88.    popupWin.focus();
  89. }
  90.